#!/bin/sh

set -e

if [ $# -ne 1 ] ; then
   echo "usage $0 <hostname>" 1>&2
   exit 1
fi

HOSTNAME=$1

# Set current hostname
hostnamectl set-hostname "$HOSTNAME"

systemctl kill -s HUP rsyslog

exit 0
